#ifndef COMMAND_H_
#define COMMAND_H_

#include "../Object.h"

#include "../../boostPtrNames.h"
#include "../Units/Unit.h"

namespace OOInterface
{

/**
 * The abstract Command class is the root of the Command hierarchy. All commands
 * that are capable of being sent to Units within this framework are children of
 * the Command class. Commands are constructed by the CommandFactory that is
 * provided by the AIInterface's getCommandFactory().
 *
 * It should be noted that this hierarchy is an application of the Command
 * pattern (GoF 233). On the range of Command patterns, this current implementation
 * is the weakest of Command patterns as it does not implement any of the logic,
 * it merely represents a request for the Command with the accompanying data
 * necessary for the Command to be completed.
 *
 * Commands are /not/ intended to be shared as it contains stateful information
 * about what Unit is performing the Command.
 *
 * @see CommandFactory, AIInterface
 */
class Command: public Object
{
public:

	/**
	 * Sets the actor of this Command. All commands must be performed by
	 * a Unit, but this is not required at instantiation of the Command.
	 *
	 * @param unit The one performing this command.
	 */
	void setActor( ConstUnitPtr unit ) {_actor = unit; }

	/**
	 * Asks the command for the current Unit that will be performing this command.
	 *
	 * @return The unit that is attempting to perform this Command.
	 */
	ConstUnitPtr getActor() const { return _actor; }

private:
	ConstUnitPtr _actor;
};

}

#endif /*COMMAND_H_*/
